﻿var page1 = new Sail.page({
    
	name     : "pageDetail",                      //定义页面对象的唯一标识
    haveNavi : false,                           //未包含导航条
    frames   : {
        name     : "editFrame",                     //该frame对象的唯一标识
        title  : "空调种类数据维护",
        getUrlParameter : ["id"],
        getURL : "../../dictionary.do?method=edit",
        postURL : "../../dictionary.do?method=save",
        bindDataFirst : false,
        //-------------------------------------------------------------------------------
        //以JSON形式描述 frame 的构成(包含哪些 item)
        //-------------------------------------------------------------------------------
        items  : [
            {
                type  : "form", 
                name  : "formDetail",
                title : "空调种类",
                
                buttons : ["保存","关闭"],
            
                items : [
						{
				        type:"input",
				        title:"空调种类名称",
				        allowBlank : false,   
				        dataIndex:"dataset.dictionaryVo.name"
				    },{
				        type:"input",
				        title:"空调种类编号",
				        allowBlank : false,
				        dataIndex:"dataset.dictionaryVo.code"
				    },{
				        type:"textArea",
				        title:"备注",
				        dataIndex:"dataset.dictionaryVo.remark",
				        height:50   
				    }
                ],
            
                layoutConfig : {
                    columns : 2
                },
                layout : [
	                    {
				            items:[
				                {'name':'空调种类名称'},
				                {'name':'空调种类编号'}
				            ]
				        },{
				            items:[
				                {name:'备注','colspan':2}
				            ]
				        }
                ]
            }
        ],
        
        //-------------------------------------------------------------------------------
        //【注】 添加 businessData 空结构
        //-------------------------------------------------------------------------------
        businessData : {
          "dataset":{
            "dictionaryVo":{
              "id":"",
              "name":"",
              "typeId":DICTIONARY_TYPE_MATERIAL_CLASS,
              "typeName":"",
              "parentId":"",
              "other1Id":"",
              "other1Id":"",
              "other2Id":"",
              "other3Id":"",
              "other4Id":"",
              "other5Id":"",
              "other6Id":"",
              "other7Id":"",
              "other8Id":"",
              "other9Id":"",
              "other10Id":"",   
              "other1Name":"",
              "other2Name":"",
              "other3Name":"",
              "other4Name":"",
              "other5Name":"",
              "other6Name":"",
              "other7Name":"",
              "other8Name":"",
              "other9Name":"",
              "other10Name":"",
              "remark":"",
              "sysFlag":SYS_FLAG_USEING,
              "creator":"",
              "createTime":"",
              "lastModifier":"",
              "lastModifiedTime":""         
            }
          }
        },

        //-------------------------------------------------------------------------------
        //【注】为当前 frame 的items 绑定事件
        //-------------------------------------------------------------------------------
        bindEvent2Items : function(){    
        	var obj_grid = $('gridSub'); 

            $('formDetail').getButton('保存').on('click',function(){
                this.saveBusiness("close");
            },this);
            
            
            $('formDetail').getButton('关闭').on('click',function(){
                this.close();
            },$('formDetail').ownerFrame);

        },
        
        beforeBindData:function(){
        	if(this.getRequest("isCopyAdd") == 'true'){
        		var dictionary = this.businessData.dataset.dictionaryVo;
        		dictionary.id = "";
          }
        	return true;
        }
    },

	afterRun : function(){
		setInitValue();
	}
});

page1.run();


function setInitValue(){	
	//增加时执行
	 
}